/**
 * Aug 9, 2020  copy right
 */
package com.code260.ss.spring3mybatis.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.code260.ss.spring3mybatis.demo.model.User;
import com.code260.ss.spring3mybatis.demo.service.UserService;

/**
 * @author code260@qq.com
 *
 */
@RestController
@RequestMapping("/user")
public class UserController {
	
	public UserController() {
		System.out.println("==Construct UserController instance==");
	}

	@Autowired
	private UserService userService;
	
	@PostMapping("/save")
	public String saveUser(@RequestBody User user) {
		this.userService.saveUser(user);
		return "ok";
	}
}
